<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>病人数据统计分析</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="../static/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../static/bower_components/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="../static/bower_components/Ionicons/css/ionicons.min.css">
    <!-- DataTables -->
    <link rel="stylesheet" href="../static/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="../static/dist/css/skins/_all-skins.min.css">
    <!-- daterange picker -->
    <link rel="stylesheet" href="../static/bower_components/bootstrap-daterangepicker/daterangepicker.css">
    <!-- bootstrap datepicker -->
    <link rel="stylesheet" href="../static/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
    <!-- iCheck for checkboxes and radio inputs -->
    <link rel="stylesheet" href="../static/plugins/iCheck/all.css">
    <!-- Select2 -->
    <link rel="stylesheet" href="../static/bower_components/select2/dist/css/select2.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="../static/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="../static/dist/css/skins/_all-skins.min.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <header class="main-header">
        <!-- Logo -->
        <a href="#" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini">超</span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg">超声波成像系统平台</span>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>

            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!--导航栏信息，已经删除-->
                </ul>
            </div>
        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- Sidebar user panel -->
            <!-- search form -->
            <!-- /.search form -->
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu" data-widget="tree">

                <li><a href="${pageContext.request.contextPath}/main/medicalRecords"><i class="fa fa-circle-o"></i>
                    病人病历管理</a></li>
                <li><a href="${pageContext.request.contextPath}/main/medicalRecordsAnalysis"><i
                        class="fa fa-circle-o"></i> 病人数据统计分析管理</a></li>
                <li><a href="${pageContext.request.contextPath}/main/imagingData"><i class="fa fa-circle-o"></i> 成像数据管理</a>
                </li>
                <li><a href="${pageContext.request.contextPath}/main/projectManage"><i class="fa fa-circle-o"></i> 项目管理</a>
                </li>
                <li><a href="${pageContext.request.contextPath}/main/commentManage"><i class="fa fa-circle-o"></i>
                    评价体系管理</a></li>
                <li><a href="${pageContext.request.contextPath}/main/logManage"><i class="fa fa-circle-o"></i> 平台日志信息管理</a>
                </li>
                <li><a href="${pageContext.request.contextPath}/main/consumableMaterial"><i class="fa fa-circle-o"></i>
                    平台耗材管理</a></li>
                <li><a href="${pageContext.request.contextPath}/main/userManage"><i class="fa fa-circle-o"></i>
                    平台用户及权限管理</a></li>
                <li><a href="${pageContext.request.contextPath}/main/platformPortal"><i class="fa fa-circle-o"></i>
                    超声波成像系统平台门户</a></li>
                <li><a href="${pageContext.request.contextPath}/main/sendControl"><i class="fa fa-circle-o"></i> 多通道发射控制</a>
                </li>
                <li><a href="${pageContext.request.contextPath}/main/receiveControl"><i class="fa fa-circle-o"></i>
                    多通道接收控制</a></li>
                <li><a href="${pageContext.request.contextPath}/main/syncControl"><i class="fa fa-circle-o"></i> 外部同步控制</a>
                </li>
                <li><a href="${pageContext.request.contextPath}/main/dataCollect"><i class="fa fa-circle-o"></i> 数据采集与重建</a>
                </li>
                <li><a href="${pageContext.request.contextPath}/main/waveGenerate"><i class="fa fa-circle-o"></i> 任意波束形成</a>
                </li>
                <li><a href="${pageContext.request.contextPath}/main/scriptManage"><i class="fa fa-circle-o"></i>
                    超声探头脚本管理</a></li>
                <li><a href="${pageContext.request.contextPath}/main/createImgAlgorithm"><i class="fa fa-circle-o"></i>
                    成像模式算法</a></li>
                <li><a href="${pageContext.request.contextPath}/main/resolveImgAlgorithm"><i class="fa fa-circle-o"></i>
                    图像处理算法</a></li>
                <li><a href="${pageContext.request.contextPath}/main/patientManage"><i class="fa fa-circle-o"></i>
                    病人信息管理</a></li>
            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                病人数据统计分析
                <small>详细信息</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="#">病人数据统计分析</a></li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <%--<div class="col-md-6">--%>
                <%--&lt;%&ndash;第一张图 病人年龄段分布 柱状图&ndash;%&gt;--%>
                <%--<div id="chartAgeDistribution" style="height: 250px;"></div>--%>
                <%--</div>--%>
                <div class="col-md-6">
                    <%--第二张图 病人性别分布 饼图 --%>
                    <div id="chartSexDistribution" style="height: 250px;"></div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6">
                    <%--第三张图 就诊次数分布 柱状图--%>
                    <div id="chartVisitDistribution" style="height: 250px;"></div>
                </div>
                <div class="col-md-6">

                </div>
            </div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <footer class="main-footer">
        <div class="pull-right hidden-xs">
            <b>Version</b> 1.0.0
        </div>
        <strong>Copyright &copy; 2018 <a href="#">上海大学 </a>.</strong> All rights
        reserved.
    </footer>

    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
        <!-- Create the tabs -->
        <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
            <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
            <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
            <!-- Home tab content -->
            <div class="tab-pane" id="control-sidebar-home-tab">
                <h3 class="control-sidebar-heading">Recent Activity</h3>
                <ul class="control-sidebar-menu">
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-birthday-cake bg-red"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Langdon's Birthday</h4>

                                <p>Will be 23 on April 24th</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-user bg-yellow"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Frodo Updated His Profile</h4>

                                <p>New phone +1(800)555-1234</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-envelope-o bg-light-blue"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Nora Joined Mailing List</h4>

                                <p>nora@example.com</p>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <i class="menu-icon fa fa-file-code-o bg-green"></i>

                            <div class="menu-info">
                                <h4 class="control-sidebar-subheading">Cron Job 254 Executed</h4>

                                <p>Execution time 5 seconds</p>
                            </div>
                        </a>
                    </li>
                </ul>
                <!-- /.control-sidebar-menu -->

                <h3 class="control-sidebar-heading">Tasks Progress</h3>
                <ul class="control-sidebar-menu">
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Custom Template Design
                                <span class="label label-danger pull-right">70%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-danger" style="width: 70%"></div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Update Resume
                                <span class="label label-success pull-right">95%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-success" style="width: 95%"></div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Laravel Integration
                                <span class="label label-warning pull-right">50%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-warning" style="width: 50%"></div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <h4 class="control-sidebar-subheading">
                                Back End Framework
                                <span class="label label-primary pull-right">68%</span>
                            </h4>

                            <div class="progress progress-xxs">
                                <div class="progress-bar progress-bar-primary" style="width: 68%"></div>
                            </div>
                        </a>
                    </li>
                </ul>
                <!-- /.control-sidebar-menu -->

            </div>
            <!-- /.tab-pane -->
            <!-- Stats tab content -->
            <div class="tab-pane" id="control-sidebar-stats-tab">Stats Tab Content</div>
            <!-- /.tab-pane -->
            <!-- Settings tab content -->
            <div class="tab-pane" id="control-sidebar-settings-tab">
                <form method="post">
                    <h3 class="control-sidebar-heading">General Settings</h3>

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Report panel usage
                            <input type="checkbox" class="pull-right" checked>
                        </label>

                        <p>
                            Some information about this general settings option
                        </p>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Allow mail redirect
                            <input type="checkbox" class="pull-right" checked>
                        </label>

                        <p>
                            Other sets of options are available
                        </p>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Expose author name in posts
                            <input type="checkbox" class="pull-right" checked>
                        </label>

                        <p>
                            Allow the user to show his name in blog posts
                        </p>
                    </div>
                    <!-- /.form-group -->

                    <h3 class="control-sidebar-heading">Chat Settings</h3>

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Show me as online
                            <input type="checkbox" class="pull-right" checked>
                        </label>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Turn off notifications
                            <input type="checkbox" class="pull-right">
                        </label>
                    </div>
                    <!-- /.form-group -->

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            Delete chat history
                            <a href="javascript:void(0)" class="text-red pull-right"><i class="fa fa-trash-o"></i></a>
                        </label>
                    </div>
                    <!-- /.form-group -->
                </form>
            </div>
            <!-- /.tab-pane -->
        </div>
    </aside>
    <!-- /.control-sidebar -->
    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script src="../static/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="../static/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="../static/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="../static/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="../static/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="../static/bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="../static/dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../static/dist/js/demo.js"></script>
<!-- page script -->
<!-- Select2 -->
<script src="../static/bower_components/select2/dist/js/select2.full.min.js"></script>
<!-- InputMask -->
<script src="../static/plugins/input-mask/jquery.inputmask.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="../static/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<!-- date-range-picker -->
<script src="../static/bower_components/moment/min/moment.min.js"></script>
<script src="../static/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- bootstrap datepicker -->
<script src="../static/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<!-- bootstrap color picker -->
<script src="../static/bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
<!-- bootstrap time picker -->
<script src="../static/plugins/timepicker/bootstrap-timepicker.min.js"></script>
<!-- iCheck 1.0.1 -->
<script src="../static/plugins/iCheck/icheck.min.js"></script>
<!-- ChartJS -->
<script src="../static/bower_components/chart.js/Chart.js"></script>

<!--echarts插件加载-->
<script src="../static/plugins/echarts/echarts.js"></script>
<%--echarts插件，自定义脚本--%>
<script>
    // // 第一幅图 病人年龄段分布 柱状图
    // optionAge = {
    //     title: {
    //         text: '病人年龄段分布图',
    //         left:'center',
    //         textStyle:{                 //---主标题内容样式
    //             color:'#000000'
    //         }
    //     },
    //     color: ['#3398DB'],
    //     grid: {
    //         left: '3%',
    //         right: '4%',
    //         bottom: '3%',
    //         containLabel: true
    //     },
    //     xAxis : [
    //         {
    //             type : 'category',
    //             data : ['0-18', '18-30', '30-40', '40-50', '50-60', '60-70', '70-'],
    //             axisTick: {
    //                 alignWithLabel: true
    //             }
    //         }
    //     ],
    //     yAxis : [
    //         {
    //             type : 'value'
    //         }
    //     ],
    //     series : [
    //         {
    //             name:'病人数量',
    //             type:'bar',
    //             barWidth: '30',
    //             data:[10, 52, 200, 334, 390, 330, 220]
    //         }
    //     ]
    // };
    //
    // // 基于准备好的dom，初始化echarts实例
    //
    // var myChartAge = echarts.init(document.getElementById('chartAgeDistribution'));
    //
    // // 使用刚指定的配置项和数据显示图表。
    //
    // myChartAge.setOption(optionAge);

    // 第二幅图 装车实效分析
    var optionSex = {
        title : {
            text: '病人性别分布',
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            type: 'scroll',
            orient: 'vertical',
            right: 10,
            top: 20,
            bottom: 20,
            data: ["男", "女"],

            selected: {"男": true, "女": true}
        },
        series : [
            {
                name: '姓名',
                type: 'pie',
                radius : '55%',
                center: ['40%', '50%'],
                data: [],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };

    // 基于准备好的dom，初始化echarts实例

    var myChartSex = echarts.init(document.getElementById('chartSexDistribution'));

    // 使用刚指定的配置项和数据显示图表。

    // myChartSex.setOption(optionSex);

    // chartVisitDistribution
    // 第三幅图 就诊次数分布 柱状图
    optionVisit = {
        title: {
            text: '就诊次数分布图',
            left: 'center',
            textStyle: {                 //---主标题内容样式
                color: '#000000'
            }
        },
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        color: ['#3398DB'],
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                data: ['0-1', '2-5', '6-10', '10-15', '15-'],
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis: [
            {
                type: 'value'
            }
        ],
        series: [
            {
                name: '病人数量',
                type: 'bar',
                barWidth: '30',
                data: []
            }
        ]
    };

    // 基于准备好的dom，初始化echarts实例

    var myChartVisit = echarts.init(document.getElementById('chartVisitDistribution'));

    // 使用刚指定的配置项和数据显示图表。

    // myChartVisit.setOption(optionVisit);
</script>

<script>
    $(document).ready(function () {
        //do something
        getData();
    })
</script>

<script>
    function getData() {
        $.get("${pageContext.request.contextPath}/main/getChartsData.do", function (data, status) {
            if (status === 'success') {
                var json = JSON.parse(data);
                var sexData = [
                    {value: json.male, name: "男"},
                    {value: json.female, name: "女"}
                ];
                optionSex.series[0].data = sexData;
                // 使用刚指定的配置项和数据显示图表。
                myChartSex.setOption(optionSex);

                optionVisit.series[0].data = json.nVisit;

                myChartVisit.setOption(optionVisit)
            } else {
                alert("获取数据失败!!!")
            }

        });
    }
</script>
</body>
</html>
